import model
import cherrypy

from UIObject import UIObject
from UIExtrato import UIExtrato
from UIChart import UIChart

class Root:
    def index(self):
        return ''
    index.expose = False

class UIRecurso(UIObject):
    table_schema = model.Recurso
    def __init__(self, *args, **wargs):
        UIObject.__init__(self, UIRecurso)

class UIDespesa(UIObject):
    table_schema = model.Despesa
    def __init__(self, *args, **wargs):
        UIObject.__init__(self, UIDespesa)

class UITransacao(UIObject):
    table_schema = model.Transacao
    def __init__(self, *args, **wargs):
        UIObject.__init__(self, UITransacao)
    
class UITemplate(UIObject):
    table_schema = model.Template
    def __init__(self, *args, **wargs):
        UIObject.__init__(self, UITemplate)
    

root = Root()
root.despesa = UIDespesa()
root.recurso = UIRecurso()
root.template = UITemplate()
root.transacao = UITransacao()
root.extrato = UIExtrato()
root.chart = UIChart()

import os.path
thisdir = os.path.dirname(__file__)
#cherrypy.tree.mount()


if __name__ == '__main__':
    cherrypy.quickstart(root, config=os.path.join(thisdir, 'tutorial.conf'))

